package hotciv.winningstrategies;

import hotciv.framework.GameContext;
import hotciv.framework.Player;
import hotciv.framework.WinningStrategy;

public class AlternatingWinningStrategy implements WinningStrategy{

	private WinningStrategy conquerAllCitiesStrategy;
	private WinningStrategy threeWinsWinningStrategy;
	
	public AlternatingWinningStrategy(WinningStrategy conquerAllCitiesStrategy, WinningStrategy threeWinsWinningStrategy)
	{
		this.conquerAllCitiesStrategy = conquerAllCitiesStrategy;
		this.threeWinsWinningStrategy = threeWinsWinningStrategy;
	}
	@Override
	public Player getWinner(GameContext g) {
		while(g.getAge() < -2000)
		{
			return conquerAllCitiesStrategy.getWinner(g);
		}	
		return threeWinsWinningStrategy.getWinner(g);
	}
	
	
}
